#ifndef EDITORCORE_CREATEACTION_H
#define EDITORCORE_CREATEACTION_H

#include "EditorCore/Actions/Action.h"
#include "EditorCore/IEntity.h"
#include "EditorCore/Visitors/HierarchyDeleter.h"

namespace editor_core {

	class CreateAction : public Action
	{
	public:
		CreateAction();
		virtual ~CreateAction();

		virtual inline ActionType GetType() const { return ActionType::Undoable; }

	protected:
		virtual bool Commit();
		virtual void Recommit();
		virtual void Rollback();

		virtual IEntity* CreateEntity() = 0;

	private:
		IEntity* m_createdEntity;
		HierarchyDeleter* m_deleter;
	};
}

#endif
